package com.sky.mapper;

import com.sky.entity.User;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

@Mapper
public interface UserMapper {
    //根据openid来查数据 返回的User对象

    /**
     * 根据openid查询用户
     * @param openid
     * @return
     */
    @Select("select * from users where openid = #{openid}")
    User getByOpenId(String openid);


    /**
     * 插入数据  需要返回值
     */
    void insert(User user);


    @Select("select * from users where id = #{id}")
    User getById(Long userId);
}
